package org.jxf.gps.jt808.message;

import java.sql.Timestamp;

import org.jfk.core.utils.ByteUtils;

public class Message {
	//开始标志位
	public byte b_flag;
	
	//消息ID
	public int msgId;
	
	//是否组包
	public boolean pkg;
	
	//加密方式
	public int cipher;
	
	//包长度
	public int length;
	
	//终端手机号
	public String mdn;
	
	//消息流水号
	public int sn;	
	
	//消息总包数
	public int pkg_total;
	
	//包序号
	public int pkg_order;	
	
	//消息体
	public byte[] body;
	
	//校验位
	public byte crc;
	
	//结束标志位
	public byte e_flag;
	
	public String channelInfo;
	
	public Timestamp moTime;
	
	MsgBody mBody = null;
	
	public String toString(){
//		String s = "mdn = "+mdn+","
//			+"pkg = "+pkg+","
//			+"msgId = "+ByteUtils.intToWordString(msgId)+","
//			+"crc = "+ByteUtils.byteToHexString(crc)+","
//			+"sn = "+sn+","
//			+"length = "+length+","
//			+ByteUtils.byteToHexString(body);
		String s = "mdn = "+mdn+","
				+"pkg = "+pkg+","
				+"channelInfo = "+channelInfo+","
				+"msgId = "+ByteUtils.intToWordString(msgId)+","
				+"crc = "+ByteUtils.byteToHexString(crc)+","
				+"sn = "+sn+","
				+"length = "+length+","
				+mBody+" body"
				+ByteUtils.byteToHexString(body);
		return s;
	}

}
